<!DOCTYPE html>



  


<html class="theme-next muse use-motion" lang="zh-CN">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Hexo, NexT" />










<meta name="description" content="私有库的制作很多时候我可以封装一些代码独立,日后使用,可变异性,装逼…">
<meta property="og:type" content="article">
<meta property="og:title" content="私有库">
<meta property="og:url" content="http://yoursite.com/2018/07/21/私有库/index.html">
<meta property="og:site_name" content="Erhqe">
<meta property="og:description" content="私有库的制作很多时候我可以封装一些代码独立,日后使用,可变异性,装逼…">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="https://ws1.sinaimg.cn/large/006tNc79ly1fthlrqf2c1j30h30i1myn.jpg">
<meta property="og:image" content="https://ws1.sinaimg.cn/large/006tNc79ly1fthlu844fmj30b502qdg4.jpg">
<meta property="og:image" content="https://ws1.sinaimg.cn/large/006tNc79ly1fthlv4dgx7j30hh0hwdh9.jpg">
<meta property="og:image" content="https://ws1.sinaimg.cn/large/006tNc79ly1fthnafjarhj30gp0a0gmv.jpg">
<meta property="og:image" content="https://ws4.sinaimg.cn/large/006tNc79ly1fthnb8l3gjj3093025gll.jpg">
<meta property="og:image" content="https://ws2.sinaimg.cn/large/006tNc79ly1ftho7l5k2ij308a02mmxc.jpg">
<meta property="og:image" content="https://ws4.sinaimg.cn/large/006tNc79ly1fthp7roebgj30fs051t9j.jpg">
<meta property="og:updated_time" content="2019-07-19T05:40:06.057Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="私有库">
<meta name="twitter:description" content="私有库的制作很多时候我可以封装一些代码独立,日后使用,可变异性,装逼…">
<meta name="twitter:image" content="https://ws1.sinaimg.cn/large/006tNc79ly1fthlrqf2c1j30h30i1myn.jpg">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Muse',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: 'Author'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/2018/07/21/私有库/"/>





  <title>私有库 | Erhqe</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Erhqe</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            Home
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            Categories
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            Archives
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2018/07/21/私有库/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Erhqe">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/10.png">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Erhqe">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">私有库</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">Posted on</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2018-07-21T17:11:42+08:00">
                2018-07-21
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">In</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/私有库/" itemprop="url" rel="index">
                    <span itemprop="name">私有库</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a href="/2018/07/21/私有库/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count valine-comment-count" data-xid="/2018/07/21/私有库/" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h4 id="私有库的制作"><a href="#私有库的制作" class="headerlink" title="私有库的制作"></a>私有库的制作</h4><p><strong>很多时候我可以封装一些代码独立,日后使用,可变异性,装逼…</strong><a id="more"></a></p>
<h5 id="首先创建远程私有索引库-当前是在码云上创建的"><a href="#首先创建远程私有索引库-当前是在码云上创建的" class="headerlink" title="首先创建远程私有索引库,当前是在码云上创建的"></a>首先创建远程私有索引库,当前是在码云上创建的</h5><p><img src="https://ws1.sinaimg.cn/large/006tNc79ly1fthlrqf2c1j30h30i1myn.jpg" alt=""></p>
<h5 id="把远程仓库添加到本地"><a href="#把远程仓库添加到本地" class="headerlink" title="把远程仓库添加到本地"></a>把远程仓库添加到本地</h5><figure class="highlight ruby"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">/<span class="regexp">/	命令</span></span><br><span class="line"><span class="regexp">pod repo add BRCS(BRCS这个是名称) https:/</span><span class="regexp">/gitee.com/</span>Min_amdrl/BRCSSpec.git</span><br></pre></td></tr></table></figure>
<p><img src="https://ws1.sinaimg.cn/large/006tNc79ly1fthlu844fmj30b502qdg4.jpg" alt=""></p>
<h5 id="创建远程代码仓库"><a href="#创建远程代码仓库" class="headerlink" title="创建远程代码仓库"></a>创建远程代码仓库</h5><p><img src="https://ws1.sinaimg.cn/large/006tNc79ly1fthlv4dgx7j30hh0hwdh9.jpg" alt=""></p>
<h5 id="创建测试工程"><a href="#创建测试工程" class="headerlink" title="创建测试工程"></a>创建测试工程</h5><figure class="highlight ruby"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">/<span class="regexp">/ 创建一个文件夹 CD进去</span></span><br><span class="line"><span class="regexp">pod lib create Emoticon</span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">Would you like to include a demo application with your library? [ Yes /</span> No ]是否需要一个Demo 需要!YES</span><br><span class="line"></span><br><span class="line">Which testing frameworks will you use? [ Quick / None ] 测试框架用的None 不需要</span><br><span class="line"></span><br><span class="line">Would you like to <span class="keyword">do</span> view based testing? [ Yes / No ] 视图测试时不需要 NO</span><br></pre></td></tr></table></figure>
<h5 id="代开刚刚创建的工程"><a href="#代开刚刚创建的工程" class="headerlink" title="代开刚刚创建的工程"></a>代开刚刚创建的工程</h5><figure class="highlight ruby"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">把ReplaceMe替换成自己的代码</span><br><span class="line">关闭项目</span><br><span class="line">pod install </span><br><span class="line">修改一些需要修改的比如运行版本</span><br></pre></td></tr></table></figure>
<h5 id="修改podspec文件"><a href="#修改podspec文件" class="headerlink" title="修改podspec文件"></a>修改podspec文件</h5><figure class="highlight ruby"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">s.summary = <span class="string">'BRCS.'</span>详情</span><br><span class="line">s.description = &lt;&lt;-DESC <span class="symbol">TODO:</span>BRCS.具体描述一定要比summary要长 DESC /<span class="regexp">/好像是不能删除换行</span></span><br><span class="line"><span class="regexp">s.homepage = '[[https:/</span><span class="regexp">/gitee.com/</span>Min_amdrl/BRCSBase<span class="string">'项目首页]</span></span><br><span class="line"><span class="string">s.source = &#123; :git =&gt; '</span><span class="symbol">https:</span>/<span class="regexp">/gitee.com/</span>Min_amdrl/BRCSBase.git<span class="string">', :tag =&gt; s.version.to_s &#125; 版本之后添加打标签</span></span><br><span class="line"><span class="string">s.ios.deployment_target = '</span><span class="number">11.0</span><span class="string">' 最底裤的版本!根据代码的支持版</span></span><br><span class="line"><span class="string">s.source_files = '</span>BRCS/Classes/**<span class="regexp">/*' 不用改了!已经帮我们搞定了!也就是代码的路径</span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span><span class="regexp">/依赖 比如依赖AFNetworking</span></span><br><span class="line"><span class="regexp">s.dependency 'AFNetworking', '~&gt; 2.3'</span></span><br></pre></td></tr></table></figure>
<h5 id="验证本地Spec文件-本地验证是不会去验证Tag的"><a href="#验证本地Spec文件-本地验证是不会去验证Tag的" class="headerlink" title="验证本地Spec文件,本地验证是不会去验证Tag的"></a>验证本地Spec文件,本地验证是不会去验证Tag的</h5><figure class="highlight ruby"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line">pod lib lint			/<span class="regexp">/ 如果Spec文件中有自己索引库的框架依赖的话提示错误找不到框架,可以忽略,直接验证远程(pod repo push 自己的索引库名 Spec文件.podspec )</span></span><br><span class="line"><span class="regexp">/</span><span class="regexp">/	可能出现的一些错误</span></span><br><span class="line"><span class="regexp">错</span></span><br><span class="line"><span class="regexp">误① Source: Git SSH URLs will NOT work for people behind firewalls configured to only allow HTTP, therefore HTTPS is preferred.</span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">对于只允许HTTP的防火墙的人来说，Git SSH url是不适用的，因此HTTPS是首选的。因为我用的是SSH(解决方案把SSH换成HTTPS)就不报错了</span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">错误② swift_version: The validator used Swift 3.2 by default because no Swift version was specified. If you want to use a different version of Swift during validation, then either use the `--swift-version` parameter or use a `.swift-version` file to set the version of Swift to use for your Pod. For example to use Swift 4.0, run: `echo "4.0" &gt; .swift-version`.</span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">大致意思是Swift版本默认情况是3.2按照提示解决</span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">解决方法一 指定多个版本 --swift-version '版本号,多个逗号隔开'.swift-version</span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">解决方法二 指定一个版本按照提示运行 echo "4.0"&gt;.swift-version (我这样用的上一个没用)</span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">错误③ url: The URL (https:/</span><span class="regexp">/gitee.com/</span>Min_amdrl/BRCSBase\ is <span class="keyword">not</span> reachable.</span><br><span class="line"></span><br><span class="line">主页URL无法访问 解决方法按照红色的警告</span><br><span class="line"></span><br><span class="line">解决方法① 可以忽略 pod lib lint --allow-warnings(试过能用)</span><br><span class="line"></span><br><span class="line">解决方法② pod lib lint --private (我用的因为是私有库)</span><br><span class="line"></span><br><span class="line">解决方法③ pod lib lint --no-clean(没试过)</span><br></pre></td></tr></table></figure>
<h5 id="验证通过之后"><a href="#验证通过之后" class="headerlink" title="验证通过之后"></a>验证通过之后</h5><figure class="highlight ruby"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">/<span class="regexp">/ 把刚才的一些修改保存提交</span></span><br><span class="line"><span class="regexp">git status 查看</span></span><br><span class="line"><span class="regexp">git add .</span></span><br><span class="line"><span class="regexp">git c-m "spec文件修改"</span></span><br></pre></td></tr></table></figure>
<h5 id="在添加远程仓库"><a href="#在添加远程仓库" class="headerlink" title="在添加远程仓库"></a>在添加远程仓库</h5><figure class="highlight ruby"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">remote add origin <span class="symbol">https:</span>/<span class="regexp">/gitee.com/</span>Min_amdrl/BRCSBase.git</span><br><span class="line">git pull origin master /<span class="regexp">/出现错误先pull再push</span></span><br><span class="line"><span class="regexp">git pull origin master --allow-unrelated-histories (解决成功拉取都本地)之后 add . c-m "pull再次提交本地"</span></span><br><span class="line"><span class="regexp">git push origin master</span></span><br></pre></td></tr></table></figure>
<h5 id="给刚才上传的代码打tag"><a href="#给刚才上传的代码打tag" class="headerlink" title="给刚才上传的代码打tag"></a>给刚才上传的代码打tag</h5><figure class="highlight ruby"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git tag <span class="string">'0.1.0'</span> 标签必须和 spec文件里的s.version 保持一致</span><br><span class="line">git push --tags 推到远程代码仓库 (刷新远程代码仓库会看到标签)</span><br></pre></td></tr></table></figure>
<h5 id="远程Spec文件验证没有打tag之前不会验证通过"><a href="#远程Spec文件验证没有打tag之前不会验证通过" class="headerlink" title="远程Spec文件验证没有打tag之前不会验证通过"></a>远程Spec文件验证没有打tag之前不会验证通过</h5><figure class="highlight ruby"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pod spec lint	/<span class="regexp">/可能有验证失败提示使用pod spec lint --private就用</span></span><br></pre></td></tr></table></figure>
<h5 id="将Spec文件添加到自己的索引库-本地-远程"><a href="#将Spec文件添加到自己的索引库-本地-远程" class="headerlink" title="将Spec文件添加到自己的索引库(本地+远程)"></a>将Spec文件添加到自己的索引库(本地+远程)</h5><figure class="highlight ruby"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">pod repo push 自己的索引库名 Spec文件.podspec </span><br><span class="line">/<span class="regexp">/	一单添加到自己的索引中会自动上传到远程的索引库中</span></span><br></pre></td></tr></table></figure>
<h5 id="查看自己的代码"><a href="#查看自己的代码" class="headerlink" title="查看自己的代码"></a>查看自己的代码</h5><figure class="highlight ruby"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pod search Emoticon</span><br></pre></td></tr></table></figure>
<h5 id="使用注意点"><a href="#使用注意点" class="headerlink" title="使用注意点"></a>使用注意点</h5><figure class="highlight ruby"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#添加自己的索引库地址</span></span><br><span class="line">source <span class="string">'https://gitee.com/Min_amdrl/BRCSSpec.git'</span>用来检索自由的框架</span><br><span class="line"></span><br><span class="line"><span class="comment">#添加公共的索引库地址</span></span><br><span class="line">source <span class="string">'https://github.com/CocoaPods/Specs.git'</span>用来检索公共的框架</span><br><span class="line"></span><br><span class="line"><span class="comment"># platform :ios, '11.0'</span></span><br><span class="line"></span><br><span class="line">target <span class="string">'删除'</span> <span class="keyword">do</span></span><br><span class="line"></span><br><span class="line">use_frameworks!</span><br><span class="line"></span><br><span class="line">pod <span class="string">'BRCS'</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">end</span></span><br></pre></td></tr></table></figure>
<hr>
<h4 id="库升级"><a href="#库升级" class="headerlink" title="库升级"></a>库升级</h4><p><strong>clone到本地打开工程,修改工程代码(升级),设置版本号,如果用框架依赖在Spec文件中添加依赖</strong></p>
<figure class="highlight ruby"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">git add .</span><br><span class="line">git c-m <span class="string">"xxx"</span></span><br><span class="line">git push origin master </span><br><span class="line">/<span class="regexp">/ 为新的代码打tag</span></span><br><span class="line"><span class="regexp">git tag '必须很Spec文件Version一致'</span></span><br><span class="line"><span class="regexp">git push --tags</span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">pod spec lint</span></span><br><span class="line"><span class="regexp">pod repo push 自己的索引库名 Spec文件.podspec</span></span><br></pre></td></tr></table></figure>
<h5 id="删除tag"><a href="#删除tag" class="headerlink" title="删除tag"></a>删除tag</h5><figure class="highlight ruby"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git tag -d <span class="string">'0.1.0'</span>	/<span class="regexp">/先删除本地tag</span></span><br><span class="line"><span class="regexp">git push origin : 0.1.0</span></span><br></pre></td></tr></table></figure>
<hr>
<h4 id="框架资源管理"><a href="#框架资源管理" class="headerlink" title="框架资源管理"></a>框架资源管理</h4><p><strong>资源位置</strong></p>
<p><img src="https://ws1.sinaimg.cn/large/006tNc79ly1fthnafjarhj30gp0a0gmv.jpg" alt=""></p>
<p><strong>修改Spec文件</strong></p>
<p><img src="https://ws4.sinaimg.cn/large/006tNc79ly1fthnb8l3gjj3093025gll.jpg" alt=""></p>
<h5 id="把资源加载到工程里面"><a href="#把资源加载到工程里面" class="headerlink" title="把资源加载到工程里面"></a>把资源加载到工程里面</h5><figure class="highlight ruby"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pod install</span><br></pre></td></tr></table></figure>
<h5 id="框架中XIB文件中使用Assets文件下的图片"><a href="#框架中XIB文件中使用Assets文件下的图片" class="headerlink" title="框架中XIB文件中使用Assets文件下的图片"></a>框架中XIB文件中使用Assets文件下的图片</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">// 打开项目中的Products文件选中.App文件ShowInFinder→显示包内容→找到框架的.framework文件在这下面有XIB,也有图片资源</span><br><span class="line">//	如果我们直接用图片名设置图片的话,会提示找布套图片,因为它在别的包中,</span><br></pre></td></tr></table></figure>
<p><strong>XIB</strong></p>
<p><img src="https://ws2.sinaimg.cn/large/006tNc79ly1ftho7l5k2ij308a02mmxc.jpg" alt=""></p>
<p><strong>代码@多少倍X这个可以用屏幕的缩放比例获取数字</strong></p>
<figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"> <span class="keyword">let</span> currentBundle = <span class="type">Bundle</span>(<span class="keyword">for</span>: <span class="keyword">self</span>.classForCoder)        </span><br><span class="line"><span class="comment">//这个方法是直接在currentBundle目录下面的文件才能找到 !因为我们的图片在MainModule.framework/MainModule.bundle/里面所以用下面的方法,而且图片名称必须写全tabbar_bg@3x.png</span></span><br><span class="line"><span class="comment">//        currentBundle.path(forResource: "tabbar_bg", ofType: "png")</span></span><br><span class="line"><span class="keyword">let</span> imagePath = currentBundle.path(forResource: <span class="string">"tabbar_bg@3x.png"</span>, ofType: <span class="literal">nil</span>, inDirectory: <span class="string">"MainModule.bundle"</span>)</span><br><span class="line">        </span><br><span class="line"><span class="comment">//        backgroundImage = UIImage(named: "tabbar_bg")</span></span><br><span class="line">        backgroundImage = <span class="type">UIImage</span>(contentsOfFile: imagePath!)</span><br></pre></td></tr></table></figure>
<h4 id="提交Spec文件时候如果出现资源匹配不到的错误-但是远程文件都没问题-本地也没问题-清除缓存-重新来一遍’pod-cache-clean-—all"><a href="#提交Spec文件时候如果出现资源匹配不到的错误-但是远程文件都没问题-本地也没问题-清除缓存-重新来一遍’pod-cache-clean-—all" class="headerlink" title="提交Spec文件时候如果出现资源匹配不到的错误!但是远程文件都没问题,本地也没问题  清除缓存 重新来一遍’pod cache clean —all"></a>提交Spec文件时候如果出现资源匹配不到的错误!但是远程文件都没问题,本地也没问题  清除缓存 重新来一遍’pod cache clean —all</h4><hr>
<h4 id="框架划分-SubSpecs"><a href="#框架划分-SubSpecs" class="headerlink" title="框架划分(SubSpecs)"></a>框架划分(SubSpecs)</h4><figure class="highlight ruby"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line">/<span class="regexp">/ 首先注释调</span></span><br><span class="line"><span class="regexp">#s.source_files = 'BRBase/</span>Classes/**<span class="regexp">/*'</span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp"># BaseTool 是subSpec名 b 是别名</span></span><br><span class="line"><span class="regexp">s.subspec 'BaseTool' do | b |</span></span><br><span class="line"><span class="regexp">		# 指定文件夹</span></span><br><span class="line"><span class="regexp">        b.source_files = 'BRBase/</span>Classes/BaseTool/**<span class="regexp">/*'	</span></span><br><span class="line"><span class="regexp">    end</span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">    s.subspec 'Extension' do | e |</span></span><br><span class="line"><span class="regexp">        e.source_files = 'BRBase/</span>Classes/Extension/**<span class="regexp">/*'</span></span><br><span class="line"><span class="regexp">    end</span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">    s.subspec 'HTTPTool' do | h |</span></span><br><span class="line"><span class="regexp">        h.source_files = 'BRBase/</span>Classes/HTTPTool/**<span class="regexp">/*'</span></span><br><span class="line"><span class="regexp">        #如果该子库依赖别的框架</span></span><br><span class="line"><span class="regexp">        h.dependency 'Kingfisher'</span></span><br><span class="line"><span class="regexp">        h.dependency 'Alamofire'</span></span><br><span class="line"><span class="regexp">    end</span></span><br></pre></td></tr></table></figure>
<p><img src="https://ws4.sinaimg.cn/large/006tNc79ly1fthp7roebgj30fs051t9j.jpg" alt=""></p>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2018/07/20/正则表达式/" rel="next" title="正则表达式">
                <i class="fa fa-chevron-left"></i> 正则表达式
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2018/07/22/位运算Options/" rel="prev" title="位运算Options">
                位运算Options <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
    </div>
  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            Table of Contents
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            Overview
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image"
                src="/images/10.png"
                alt="Erhqe" />
            
              <p class="site-author-name" itemprop="name">Erhqe</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">70</span>
                  <span class="site-state-item-name">posts</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                
                  <span class="site-state-item-count">31</span>
                  <span class="site-state-item-name">categories</span>
                
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                
                  <span class="site-state-item-count">1</span>
                  <span class="site-state-item-name">tags</span>
                
              </div>
            

          </nav>

          

          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-4"><a class="nav-link" href="#私有库的制作"><span class="nav-number">1.</span> <span class="nav-text">私有库的制作</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#首先创建远程私有索引库-当前是在码云上创建的"><span class="nav-number">1.1.</span> <span class="nav-text">首先创建远程私有索引库,当前是在码云上创建的</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#把远程仓库添加到本地"><span class="nav-number">1.2.</span> <span class="nav-text">把远程仓库添加到本地</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#创建远程代码仓库"><span class="nav-number">1.3.</span> <span class="nav-text">创建远程代码仓库</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#创建测试工程"><span class="nav-number">1.4.</span> <span class="nav-text">创建测试工程</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#代开刚刚创建的工程"><span class="nav-number">1.5.</span> <span class="nav-text">代开刚刚创建的工程</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#修改podspec文件"><span class="nav-number">1.6.</span> <span class="nav-text">修改podspec文件</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#验证本地Spec文件-本地验证是不会去验证Tag的"><span class="nav-number">1.7.</span> <span class="nav-text">验证本地Spec文件,本地验证是不会去验证Tag的</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#验证通过之后"><span class="nav-number">1.8.</span> <span class="nav-text">验证通过之后</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#在添加远程仓库"><span class="nav-number">1.9.</span> <span class="nav-text">在添加远程仓库</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#给刚才上传的代码打tag"><span class="nav-number">1.10.</span> <span class="nav-text">给刚才上传的代码打tag</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#远程Spec文件验证没有打tag之前不会验证通过"><span class="nav-number">1.11.</span> <span class="nav-text">远程Spec文件验证没有打tag之前不会验证通过</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#将Spec文件添加到自己的索引库-本地-远程"><span class="nav-number">1.12.</span> <span class="nav-text">将Spec文件添加到自己的索引库(本地+远程)</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#查看自己的代码"><span class="nav-number">1.13.</span> <span class="nav-text">查看自己的代码</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#使用注意点"><span class="nav-number">1.14.</span> <span class="nav-text">使用注意点</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#库升级"><span class="nav-number">2.</span> <span class="nav-text">库升级</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#删除tag"><span class="nav-number">2.1.</span> <span class="nav-text">删除tag</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#框架资源管理"><span class="nav-number">3.</span> <span class="nav-text">框架资源管理</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#把资源加载到工程里面"><span class="nav-number">3.1.</span> <span class="nav-text">把资源加载到工程里面</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#框架中XIB文件中使用Assets文件下的图片"><span class="nav-number">3.2.</span> <span class="nav-text">框架中XIB文件中使用Assets文件下的图片</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#提交Spec文件时候如果出现资源匹配不到的错误-但是远程文件都没问题-本地也没问题-清除缓存-重新来一遍’pod-cache-clean-—all"><span class="nav-number">4.</span> <span class="nav-text">提交Spec文件时候如果出现资源匹配不到的错误!但是远程文件都没问题,本地也没问题  清除缓存 重新来一遍’pod cache clean —all</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#框架划分-SubSpecs"><span class="nav-number">5.</span> <span class="nav-text">框架划分(SubSpecs)</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Erhqe</span>

  
</div>


  <div class="powered-by">Powered by <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a></div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">Theme &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Muse</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  










  <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
  <script src="//unpkg.com/valine/dist/Valine.min.js"></script>
  
  <script type="text/javascript">
    var GUEST = ['nick','mail','link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item=>{
      return GUEST.indexOf(item)>-1;
    });
    new Valine({
        el: '#comments' ,
        verify: false,
        notify: false,
        appId: 'TiAY2J24ECwQH9uLYsoJpgIK-gzGzoHsz',
        appKey: 'Y9PiVrPXVmfNsv4Aa6cPsADG',
        placeholder: 'Just go go',
        avatar:'mm',
        guest_info:guest,
        pageSize:'10' || 10,
    });
  </script>



  





  

  

  

  
  

  

  

  

</body>
</html>
